Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(clustering) inline version negotiation #8926

Merged
merged 14 commits into from
Jun 22, 2022

Conversation

StarlightIbuki
Copy link
Contributor

@StarlightIbuki StarlightIbuki commented Jun 9, 2022

Due to refactoring, #8775 has a lot of merging conflicts. So this is a retry of that.

I've also refactored this and designed it a little differently. And I added a check before the config sync process.

fix FT-3005

Copy link
Contributor

@javierguerragiraldez javierguerragiraldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code structure seems very good, but needs tests to be sure of corner cases, especially about data transformations and priority logic.

most of my comments are minor, except for some dubious optimizations that reduce readability or cross abstraction responsibilities. especially about merging the accepted and rejected structures, just because they have similar fields.

kong/clustering/services/negotiation.lua Outdated Show resolved Hide resolved
kong-2.8.0-0.rockspec Show resolved Hide resolved
kong/clustering/services/negotiation.lua Outdated Show resolved Hide resolved
kong/clustering/services/negotiation.lua Outdated Show resolved Hide resolved
kong/clustering/services/negotiation.lua Outdated Show resolved Hide resolved
kong/clustering/services/negotiation.lua Show resolved Hide resolved
kong/clustering/services/supported.lua Outdated Show resolved Hide resolved
kong/clustering/services/supported.lua Outdated Show resolved Hide resolved
kong/clustering/wrpc_control_plane.lua Outdated Show resolved Hide resolved
@chronolaw
Copy link
Contributor

I think maybe after this PR, we should add some test cases to cover wrpc feature.

@StarlightIbuki
Copy link
Contributor Author

I think maybe after this PR, we should add some test cases to cover wrpc feature.

Still I need to add another feature first, so we can unblock the global rate limiting.

@StarlightIbuki StarlightIbuki force-pushed the feat/inline_version_negotiation branch from da4de46 to b40523e Compare June 16, 2022 08:37
Copy link
Contributor

@javierguerragiraldez javierguerragiraldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

happy to see a much more robust data representation.

there's still an issue, however: while it's perfectly OK to use a map in protobuf, i don't see any advantage here. I've previously mentioned that the amount of data manipulation here makes tests particularly important (because it's hard to be sure of the "shape" of the data produced at every step); now I think that changing replacing those maps with arrays would greatly simplify the code, removing most of the complex transformations.

kong/clustering/services/negotiation.lua Show resolved Hide resolved
kong/clustering/services/negotiation.lua Show resolved Hide resolved
kong/clustering/services/negotiation.lua Outdated Show resolved Hide resolved
kong/clustering/services/negotiation.lua Show resolved Hide resolved
kong/clustering/services/negotiation.lua Outdated Show resolved Hide resolved
kong/clustering/services/negotiation.lua Outdated Show resolved Hide resolved
@StarlightIbuki StarlightIbuki force-pushed the feat/inline_version_negotiation branch from d66a69a to 247b382 Compare June 21, 2022 03:08
Copy link
Contributor

@javierguerragiraldez javierguerragiraldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@fffonion fffonion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's take adding tests as next priority over other wrpc features @suika-kong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants